home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / InputSprocket.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  28.6 KB  |  1,030 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        InputSprocket.a
  3. ;
  4. ;    Contains:    Games Sprockets: InputSprocket interfaaces
  5. ;
  6. ;    Version:    Technology:    Input Sprocket 1.2
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__INPUTSPROCKET__') = 'UNDEFINED' THEN
  19. __INPUTSPROCKET__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  25.     include 'Events.a'
  26.     ENDIF
  27.  
  28.     IF &TYPE('USE_OLD_INPUT_SPROCKET_LABELS') = 'UNDEFINED' THEN
  29.     USE_OLD_INPUT_SPROCKET_LABELS: SET 1
  30.     ENDIF
  31.     IF &TYPE('USE_OLD_ISPNEED_STRUCT') = 'UNDEFINED' THEN
  32.     USE_OLD_ISPNEED_STRUCT: SET 1
  33.     ENDIF
  34.     IF TARGET_CPU_PPC THEN
  35. ;  ********************* data types ********************* 
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. ;  ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick 
  43. ; typedef OSType                         ISpDeviceClass
  44.  
  45. ;  ISpDeviceIdentifier is a specific device,  example: standard 1-button mouse, 105key ext. kbd. 
  46. ; typedef OSType                         ISpDeviceIdentifier
  47.  
  48. ; typedef OSType                         ISpElementLabel
  49.  
  50. ; typedef OSType                         ISpElementKind
  51.  
  52.  
  53. ;  *************** errors -30420 to -30439***************** 
  54.  
  55. kISpInternalErr                    EQU        -30420
  56. kISpSystemListErr                EQU        -30421
  57. kISpBufferToSmallErr            EQU        -30422
  58. kISpElementInListErr            EQU        -30423
  59. kISpElementNotInListErr            EQU        -30424
  60. kISpSystemInactiveErr            EQU        -30425
  61. kISpDeviceInactiveErr            EQU        -30426
  62. kISpSystemActiveErr                EQU        -30427
  63. kISpDeviceActiveErr                EQU        -30428
  64. kISpListBusyErr                    EQU        -30429
  65. ;  *************** resources **************** 
  66.  
  67. kISpApplicationResourceType        EQU        'isap'
  68. kISpSetListResourceType            EQU        'setl'
  69. kISpSetDataResourceType            EQU        'setd'
  70. ISpApplicationResourceStruct RECORD 0
  71. flags                     ds.l    1                ; offset: $0 (0)
  72. reserved1                 ds.l    1                ; offset: $4 (4)
  73. reserved2                 ds.l    1                ; offset: $8 (8)
  74. reserved3                 ds.l    1                ; offset: $C (12)
  75. sizeof                     EQU *                    ; size:   $10 (16)
  76.                         ENDR
  77.  
  78. kISpAppResFlag_UsesInputSprocket EQU    $00000001            ; true if the application uses InputSprocket
  79. kISpAppResFlag_UsesISpInit        EQU        $00000002            ; true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...)
  80. ; * ISpDeviceDefinition
  81. ; *
  82. ; * This structure provides all the available
  83. ; * information for an input device within the system
  84. ; *
  85.  
  86. ISpDeviceDefinition        RECORD 0
  87. deviceName                 ds        Str63            ; offset: $0 (0)        ;  a human readable name of the device 
  88. theDeviceClass             ds.l    1                ; offset: $40 (64)        ;  general classs of device example : keyboard, mouse, joystick 
  89. theDeviceIdentifier         ds.l    1                ; offset: $44 (68)        ;  every distinguishable device should have an OSType 
  90. permanentID                 ds.l    1                ; offset: $48 (72)        ;  a cross reboot id unique within that deviceType, 0 if not possible 
  91. flags                     ds.l    1                ; offset: $4C (76)        ;  status flags 
  92. reserved1                 ds.l    1                ; offset: $50 (80)
  93. reserved2                 ds.l    1                ; offset: $54 (84)
  94. reserved3                 ds.l    1                ; offset: $58 (88)
  95. sizeof                     EQU *                    ; size:   $5C (92)
  96.                         ENDR
  97.  
  98. kISpDeviceFlag_HandleOwnEmulation EQU    1
  99. ; * ISpElementEvent, ISpElementEventPtr
  100. ; *
  101. ; * This is the structure that event data is passed in.
  102. ; *
  103.  
  104. ISpElementEvent            RECORD 0
  105. when                     ds        AbsoluteTime    ; offset: $0 (0)        ;  this is absolute time on PCI or later, otherwise it is 
  106. ;  0 for the hi 32 bits and TickCount for the low 32 bits 
  107. element                     ds.l    1                ; offset: $8 (8)        ;  a reference to the element that generated this event 
  108. refCon                     ds.l    1                ; offset: $C (12)        ;  for application usage, 0 on the global list 
  109. data                     ds.l    1                ; offset: $10 (16)        ;  the data for this event 
  110. sizeof                     EQU *                    ; size:   $14 (20)
  111.                         ENDR
  112. ; typedef struct ISpElementEvent *        ISpElementEventPtr
  113.  
  114. ; * ISpElementInfo, ISpElementInfoPtr
  115. ; *
  116. ; * This is the generic definition of an element.
  117. ; * Every element must contain this information.
  118. ; *
  119.  
  120. ISpElementInfo            RECORD 0
  121. theLabel                 ds.l    1                ; offset: $0 (0)
  122. theKind                     ds.l    1                ; offset: $4 (4)
  123. theString                 ds        Str63            ; offset: $8 (8)
  124. reserved1                 ds.l    1                ; offset: $48 (72)
  125. reserved2                 ds.l    1                ; offset: $4C (76)
  126. sizeof                     EQU *                    ; size:   $50 (80)
  127.                         ENDR
  128. ; typedef struct ISpElementInfo *        ISpElementInfoPtr
  129.  
  130. ; typedef UInt32                         ISpNeedFlagBits
  131.  
  132.     IF USE_OLD_ISPNEED_STRUCT THEN
  133. ISpNeed                    RECORD 0
  134. name                     ds        Str63            ; offset: $0 (0)
  135. iconSuiteResourceId         ds.w    1                ; offset: $40 (64)        ;  resource id of the icon suite 
  136. reserved                 ds.w    1                ; offset: $42 (66)
  137. theKind                     ds.l    1                ; offset: $44 (68)
  138. theLabel                 ds.l    1                ; offset: $48 (72)
  139. flags                     ds.l    1                ; offset: $4C (76)
  140. reserved1                 ds.l    1                ; offset: $50 (80)
  141. reserved2                 ds.l    1                ; offset: $54 (84)
  142. reserved3                 ds.l    1                ; offset: $58 (88)
  143. sizeof                     EQU *                    ; size:   $5C (92)
  144.                         ENDR
  145.     ELSE
  146. ISpNeed                    RECORD 0
  147. name                     ds        Str63            ; offset: $0 (0)        ;  human-readable string 
  148. iconSuiteResourceId         ds.w    1                ; offset: $40 (64)        ;  resource id of the icon suite 
  149. playerNum                 ds.b    1                ; offset: $42 (66)        ;  used for multi-player support 
  150. group                     ds.b    1                ; offset: $43 (67)        ;  used to group related needs (eg, look left and look right button needs) 
  151. theKind                     ds.l    1                ; offset: $44 (68)
  152. theLabel                 ds.l    1                ; offset: $48 (72)
  153. flags                     ds.l    1                ; offset: $4C (76)
  154. reserved1                 ds.l    1                ; offset: $50 (80)
  155. reserved2                 ds.l    1                ; offset: $54 (84)
  156. reserved3                 ds.l    1                ; offset: $58 (88)
  157. sizeof                     EQU *                    ; size:   $5C (92)
  158.                         ENDR
  159.     ENDIF    ; USE_OLD_ISPNEED_STRUCT
  160.  
  161. kISpNeedFlag_NoMultiConfig        EQU        $00000001            ; once this need is autoconfigured to one device dont autoconfigure to anything else
  162. kISpNeedFlag_Utility            EQU        $00000002            ; this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard
  163. kISpNeedFlag_PolledOnly            EQU        $00000004
  164. kISpNeedFlag_EventsOnly            EQU        $00000008            ; *** kISpElementKind specific flags ***
  165.                                                             ; these are flags specific to kISpElementKind_Button
  166. kISpNeedFlag_Button_AlreadyAxis    EQU        $10000000            ; there is a axis version of this button need
  167. kISpNeedFlag_Button_ClickToggles EQU    $20000000
  168. kISpNeedFlag_Button_ActiveWhenDown EQU    $40000000            ; these are flags specific to kISpElementKind_DPad
  169.                                                             ; these are flags specific to kISpElementKind_Axis
  170. kISpNeedFlag_Axis_AlreadyButton    EQU        $10000000            ; there is a button version of this axis need
  171. kISpNeedFlag_Axis_Asymetric        EQU        $20000000            ; this axis need is asymetric    
  172.                                                             ; these are flags specific to kISpElementKind_Delta
  173. kISpNeedFlag_Delta_AlreadyAxis    EQU        $10000000            ; there is a axis version of this delta need
  174. ; *
  175. ; * These are the current built values for ISpDeviceClass
  176. ; *
  177.  
  178.  
  179. kISpDeviceClass_SpeechRecognition EQU    'talk'
  180. kISpDeviceClass_Mouse            EQU        'mous'
  181. kISpDeviceClass_Keyboard        EQU        'keyd'
  182. kISpDeviceClass_Joystick        EQU        'joys'
  183. kISpDeviceClass_Wheel            EQU        'whel'
  184. kISpDeviceClass_Pedals            EQU        'pedl'
  185. kISpDeviceClass_Levers            EQU        'levr'
  186. kISpDeviceClass_Tickle            EQU        'tckl'                ; a device of this class requires ISpTickle
  187. ; * These are the current built in ISpElementKind's
  188. ; * 
  189. ; * These are all OSTypes.
  190. ; *
  191.  
  192.  
  193. kISpElementKind_Button            EQU        'butn'
  194. kISpElementKind_DPad            EQU        'dpad'
  195. kISpElementKind_Axis            EQU        'axis'
  196. kISpElementKind_Delta            EQU        'dlta'
  197. kISpElementKind_Movement        EQU        'move'
  198. kISpElementKind_Virtual            EQU        'virt'
  199.  
  200. ; *
  201. ; * These are the current built in ISpElementLabel's
  202. ; *
  203. ; * These are all OSTypes.
  204. ; *
  205.  
  206.     IF USE_OLD_INPUT_SPROCKET_LABELS THEN
  207.  
  208.                                                             ; axis 
  209. kISpElementLabel_XAxis            EQU        'xaxi'
  210. kISpElementLabel_YAxis            EQU        'yaxi'
  211. kISpElementLabel_ZAxis            EQU        'zaxi'
  212. kISpElementLabel_Rx                EQU        'rxax'
  213. kISpElementLabel_Ry                EQU        'ryax'
  214. kISpElementLabel_Rz                EQU        'rzax'
  215. kISpElementLabel_Gas            EQU        'gasp'
  216. kISpElementLabel_Brake            EQU        'brak'
  217. kISpElementLabel_Clutch            EQU        'cltc'
  218. kISpElementLabel_Throttle        EQU        'thrt'
  219. kISpElementLabel_Trim            EQU        'trim'                ; direction pad 
  220. kISpElementLabel_POVHat            EQU        'povh'
  221. kISpElementLabel_PadMove        EQU        'move'                ; buttons 
  222. kISpElementLabel_Fire            EQU        'fire'
  223. kISpElementLabel_Start            EQU        'strt'
  224. kISpElementLabel_Select            EQU        'optn'
  225.     ENDIF    ; USE_OLD_INPUT_SPROCKET_LABELS
  226.  
  227.                                                             ; generic 
  228. kISpElementLabel_None            EQU        'none'                ; axis 
  229. kISpElementLabel_Axis_XAxis        EQU        'xaxi'
  230. kISpElementLabel_Axis_YAxis        EQU        'yaxi'
  231. kISpElementLabel_Axis_ZAxis        EQU        'zaxi'
  232. kISpElementLabel_Axis_Rx        EQU        'rxax'
  233. kISpElementLabel_Axis_Ry        EQU        'ryax'
  234. kISpElementLabel_Axis_Rz        EQU        'rzax'
  235. kISpElementLabel_Axis_Roll        EQU        'rzax'
  236. kISpElementLabel_Axis_Pitch        EQU        'rxax'
  237. kISpElementLabel_Axis_Yaw        EQU        'ryax'
  238. kISpElementLabel_Axis_RollTrim    EQU        'rxtm'
  239. kISpElementLabel_Axis_PitchTrim    EQU        'trim'
  240. kISpElementLabel_Axis_YawTrim    EQU        'rytm'
  241. kISpElementLabel_Axis_Gas        EQU        'gasp'
  242. kISpElementLabel_Axis_Brake        EQU        'brak'
  243. kISpElementLabel_Axis_Clutch    EQU        'cltc'
  244. kISpElementLabel_Axis_Throttle    EQU        'thrt'
  245. kISpElementLabel_Axis_Trim        EQU        'trim'
  246. kISpElementLabel_Axis_Rudder    EQU        'rudd'                ; delta 
  247. kISpElementLabel_Delta_X        EQU        'xdlt'
  248. kISpElementLabel_Delta_Y        EQU        'ydlt'
  249. kISpElementLabel_Delta_Z        EQU        'zdlt'
  250. kISpElementLabel_Delta_Rx        EQU        'rxdl'
  251. kISpElementLabel_Delta_Ry        EQU        'rydl'
  252. kISpElementLabel_Delta_Rz        EQU        'rzdl'
  253. kISpElementLabel_Delta_Roll        EQU        'rzdl'
  254. kISpElementLabel_Delta_Pitch    EQU        'rxdl'
  255. kISpElementLabel_Delta_Yaw        EQU        'rydl'                ; direction pad 
  256. kISpElementLabel_Pad_POV        EQU        'povh'
  257. kISpElementLabel_Pad_Move        EQU        'move'                ; buttons 
  258. kISpElementLabel_Btn_Fire        EQU        'fire'
  259. kISpElementLabel_Btn_SecondaryFire EQU    'sfir'
  260. kISpElementLabel_Btn_Jump        EQU        'jump'
  261. kISpElementLabel_Btn_PauseResume EQU    'strt'                ; kISpElementLabel_Btn_PauseResume automatically binds to escape 
  262. kISpElementLabel_Btn_Select        EQU        'optn'
  263. kISpElementLabel_Btn_SlideLeft    EQU        'blft'
  264. kISpElementLabel_Btn_SlideRight    EQU        'brgt'
  265. kISpElementLabel_Btn_MoveForward EQU    'btmf'
  266. kISpElementLabel_Btn_MoveBackward EQU    'btmb'
  267. kISpElementLabel_Btn_TurnLeft    EQU        'bttl'
  268. kISpElementLabel_Btn_TurnRight    EQU        'bttr'
  269. kISpElementLabel_Btn_LookLeft    EQU        'btll'
  270. kISpElementLabel_Btn_LookRight    EQU        'btlr'
  271. kISpElementLabel_Btn_LookUp        EQU        'btlu'
  272. kISpElementLabel_Btn_LookDown    EQU        'btld'
  273. kISpElementLabel_Btn_Next        EQU        'btnx'
  274. kISpElementLabel_Btn_Previous    EQU        'btpv'
  275. kISpElementLabel_Btn_SideStep    EQU        'side'
  276. kISpElementLabel_Btn_Run        EQU        'quik'
  277. kISpElementLabel_Btn_Look        EQU        'blok'
  278. ; *
  279. ; * direction pad data & configuration information
  280. ; *
  281.  
  282. ; typedef UInt32                         ISpDPadData
  283.  
  284.  
  285. kISpPadIdle                        EQU        0
  286. kISpPadLeft                        EQU        1
  287. kISpPadUpLeft                    EQU        2
  288. kISpPadUp                        EQU        3
  289. kISpPadUpRight                    EQU        4
  290. kISpPadRight                    EQU        5
  291. kISpPadDownRight                EQU        6
  292. kISpPadDown                        EQU        7
  293. kISpPadDownLeft                    EQU        8
  294. ISpDPadConfigurationInfo RECORD 0
  295. id                         ds.l    1                ; offset: $0 (0)        ;  ordering 1..n, 0 = no relavent ordering of direction pads 
  296. fourWayPad                 ds.b    1                ; offset: $4 (4)        ;  true if this pad can only produce idle + four directions 
  297.                          ORG 6
  298. sizeof                     EQU *                    ; size:   $6 (6)
  299.                         ENDR
  300. ; *
  301. ; * button data & configuration information
  302. ; *
  303.  
  304. ; typedef UInt32                         ISpButtonData
  305.  
  306.  
  307. kISpButtonUp                    EQU        0
  308. kISpButtonDown                    EQU        1
  309. ISpButtonConfigurationInfo RECORD 0
  310. id                         ds.l    1                ; offset: $0 (0)        ;  ordering 1..n, 0 = no relavent ordering of buttons 
  311. sizeof                     EQU *                    ; size:   $4 (4)
  312.                         ENDR
  313. ; *
  314. ; * axis data & configuration information 
  315. ; *
  316.  
  317. ; typedef UInt32                         ISpAxisData
  318.  
  319. ISpAxisConfigurationInfo RECORD 0
  320. symetricAxis             ds.b    1                ; offset: $0 (0)        ;  axis is symetric, i.e. a joystick is symetric and a gas pedal is not 
  321.                          ORG 2
  322. sizeof                     EQU *                    ; size:   $2 (2)
  323.                         ENDR
  324. ; typedef Fixed                         ISpDeltaData
  325.  
  326. ISpDeltaConfigurationInfo RECORD 0
  327. reserved1                 ds.l    1                ; offset: $0 (0)
  328. reserved2                 ds.l    1                ; offset: $4 (4)
  329. sizeof                     EQU *                    ; size:   $8 (8)
  330.                         ENDR
  331. ISpMovementData            RECORD 0
  332. xAxis                     ds.l    1                ; offset: $0 (0)
  333. yAxis                     ds.l    1                ; offset: $4 (4)
  334. direction                 ds.l    1                ; offset: $8 (8)        ;  ISpDPadData version of the movement 
  335. sizeof                     EQU *                    ; size:   $C (12)
  336.                         ENDR
  337.  
  338. kISpVirtualElementFlag_UseTempMem EQU    1
  339.  
  340. kISpElementListFlag_UseTempMem    EQU        1
  341.  
  342. kISpFirstIconSuite                EQU        30000
  343. kISpLastIconSuite                EQU        30100
  344. kISpNoneIconSuite                EQU        30000
  345. ;  ********************* user level functions ********************* 
  346.  
  347.  
  348. ; *
  349. ; * startup / shutdown
  350. ; *
  351.  
  352. ;
  353. ; extern OSStatus ISpStartup(void )
  354. ;
  355.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION ISpStartup
  357.     ENDIF
  358.  
  359. ;  1.1 or later
  360. ;
  361. ; extern OSStatus ISpShutdown(void )
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  364.         IMPORT_CFM_FUNCTION ISpShutdown
  365.     ENDIF
  366.  
  367. ;  1.1 or later
  368. ; *
  369. ; * polling
  370. ; *
  371.  
  372. ;
  373. ; extern OSStatus ISpTickle(void )
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  376.         IMPORT_CFM_FUNCTION ISpTickle
  377.     ENDIF
  378.  
  379. ;  1.1 or later
  380. ; ********** user interface functions *********
  381.  
  382. ;
  383. ; extern NumVersion ISpGetVersion(void )
  384. ;
  385.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  386.         IMPORT_CFM_FUNCTION ISpGetVersion
  387.     ENDIF
  388.  
  389. ; *
  390. ; * ISpElement_NewVirtual(ISpElementReference *outElement);
  391. ; *
  392.  
  393. ;
  394. ; extern OSStatus ISpElement_NewVirtual(UInt32 dataSize, ISpElementReference *outElement, UInt32 flags)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  397.         IMPORT_CFM_FUNCTION ISpElement_NewVirtual
  398.     ENDIF
  399.  
  400. ; *
  401. ; * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements);
  402. ; *
  403.  
  404. ;
  405. ; extern OSStatus ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeed *needs, ISpElementReference *outElements, UInt32 flags)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION ISpElement_NewVirtualFromNeeds
  409.     ENDIF
  410.  
  411. ; *
  412. ; * ISpElement_DisposeVirtual(inElement);
  413. ; *
  414.  
  415. ;
  416. ; extern OSStatus ISpElement_DisposeVirtual(UInt32 count, ISpElementReference *inElements)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  419.         IMPORT_CFM_FUNCTION ISpElement_DisposeVirtual
  420.     ENDIF
  421.  
  422. ; * ISpInit
  423. ; *
  424.  
  425. ;
  426. ; extern OSStatus ISpInit(UInt32 count, ISpNeed *needs, ISpElementReference *inReferences, OSType appCreatorCode, OSType subCreatorCode, UInt32 flags, short setListResourceId, UInt32 reserved)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION ISpInit
  430.     ENDIF
  431.  
  432.  
  433. ; * ISpConfigure
  434. ; *
  435.  
  436. ;
  437. ; extern OSStatus ISpConfigure(ISpEventProcPtr inEventProcPtr)
  438. ;
  439.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION ISpConfigure
  441.     ENDIF
  442.  
  443. ; *
  444. ; * ISpStop
  445. ; *
  446.  
  447. ;
  448. ; extern OSStatus ISpStop(void )
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  451.         IMPORT_CFM_FUNCTION ISpStop
  452.     ENDIF
  453.  
  454. ; *
  455. ; * ISpSuspend, ISpResume
  456. ; *
  457. ; * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed.
  458. ; * ISpResume resumes to the previous state of the system after a suspend call.
  459. ; * 
  460. ; * Return Codes
  461. ; * memFullErr
  462. ; *
  463.  
  464. ;
  465. ; extern OSStatus ISpSuspend(void )
  466. ;
  467.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  468.         IMPORT_CFM_FUNCTION ISpSuspend
  469.     ENDIF
  470.  
  471. ;
  472. ; extern OSStatus ISpResume(void )
  473. ;
  474.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION ISpResume
  476.     ENDIF
  477.  
  478. ; * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier
  479. ; *
  480. ; * These will extract as many device references from the system wide list as will fit in your buffer.  
  481. ; *
  482. ; * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero
  483. ; * buffer - a pointer to your buffer
  484. ; * outCount - contains the number of devices in the system
  485. ; *
  486. ; * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass
  487. ; * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier
  488. ; *
  489. ; * Return Codes
  490. ; * paramErr
  491. ; *
  492.  
  493. ;
  494. ; extern OSStatus ISpDevices_Extract(UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  495. ;
  496.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  497.         IMPORT_CFM_FUNCTION ISpDevices_Extract
  498.     ENDIF
  499.  
  500. ;
  501. ; extern OSStatus ISpDevices_ExtractByClass(ISpDeviceClass inClass, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  504.         IMPORT_CFM_FUNCTION ISpDevices_ExtractByClass
  505.     ENDIF
  506.  
  507. ;
  508. ; extern OSStatus ISpDevices_ExtractByIdentifier(ISpDeviceIdentifier inIdentifier, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  509. ;
  510.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION ISpDevices_ExtractByIdentifier
  512.     ENDIF
  513.  
  514.  
  515. ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive
  516. ; *
  517. ; * ISpDevices_Activate, ISpDevices_Deactivate
  518. ; *
  519. ; * This will activate/deactivate a block of devices.
  520. ; * inDeviceCount - the number of devices to activate / deactivate
  521. ; * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references
  522. ; *
  523. ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass
  524. ; * inClass - the class of devices to activate or deactivate
  525. ; *
  526. ; * ISpDevice_IsActive
  527. ; * inDevice - the device reference that you wish to 
  528. ; * outIsActive - a boolean value that is true when the device is active
  529. ; *
  530. ; * Return Codes
  531. ; * paramErr
  532. ; *
  533.  
  534. ;
  535. ; extern OSStatus ISpDevices_ActivateClass(ISpDeviceClass inClass)
  536. ;
  537.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  538.         IMPORT_CFM_FUNCTION ISpDevices_ActivateClass
  539.     ENDIF
  540.  
  541. ;  1.1 or later
  542. ;
  543. ; extern OSStatus ISpDevices_DeactivateClass(ISpDeviceClass inClass)
  544. ;
  545.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  546.         IMPORT_CFM_FUNCTION ISpDevices_DeactivateClass
  547.     ENDIF
  548.  
  549. ;  1.1 or later
  550. ;
  551. ; extern OSStatus ISpDevices_Activate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToActivate)
  552. ;
  553.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  554.         IMPORT_CFM_FUNCTION ISpDevices_Activate
  555.     ENDIF
  556.  
  557. ;
  558. ; extern OSStatus ISpDevices_Deactivate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToDeactivate)
  559. ;
  560.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  561.         IMPORT_CFM_FUNCTION ISpDevices_Deactivate
  562.     ENDIF
  563.  
  564. ;
  565. ; extern OSStatus ISpDevice_IsActive(ISpDeviceReference inDevice, Boolean *outIsActive)
  566. ;
  567.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  568.         IMPORT_CFM_FUNCTION ISpDevice_IsActive
  569.     ENDIF
  570.  
  571. ; * ISpDevice_GetDefinition
  572. ; *
  573. ; *
  574. ; * inDevice - the device you want to get the definition for
  575. ; * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition))
  576. ; * outStruct - a pointer to where you want the structure copied
  577. ; *
  578. ; * Return Codes
  579. ; * paramErr
  580. ; *
  581.  
  582. ;
  583. ; extern OSStatus ISpDevice_GetDefinition(ISpDeviceReference inDevice, UInt32 inBuflen, ISpDeviceDefinition *outStruct)
  584. ;
  585.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  586.         IMPORT_CFM_FUNCTION ISpDevice_GetDefinition
  587.     ENDIF
  588.  
  589.  
  590. ; *
  591. ; * ISpDevice_GetElementList
  592. ; *
  593. ; * inDevice - the device whose element list you wish to get
  594. ; * outElementList - a pointer to where you want a reference to that list stored
  595. ; *
  596. ; * Return Codes
  597. ; * paramErr
  598. ; *
  599.  
  600. ;
  601. ; extern OSStatus ISpDevice_GetElementList(ISpDeviceReference inDevice, ISpElementListReference *outElementList)
  602. ;
  603.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  604.         IMPORT_CFM_FUNCTION ISpDevice_GetElementList
  605.     ENDIF
  606.  
  607. ; *
  608. ; * takes an ISpElementReference and returns the group that it is in or 0 if there is
  609. ; * no group
  610. ; *
  611. ; * Return Codes
  612. ; * paramErr
  613. ; *
  614.  
  615. ;
  616. ; extern OSStatus ISpElement_GetGroup(ISpElementReference inElement, UInt32 *outGroup)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION ISpElement_GetGroup
  620.     ENDIF
  621.  
  622. ; *
  623. ; * takes an ISpElementReference and returns the device that the element belongs 
  624. ; * to.
  625. ; *
  626. ; * Return Codes
  627. ; * paramErr if inElement is 0 or outDevice is nil
  628. ; *
  629.  
  630. ;
  631. ; extern OSStatus ISpElement_GetDevice(ISpElementReference inElement, ISpDeviceReference *outDevice)
  632. ;
  633.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  634.         IMPORT_CFM_FUNCTION ISpElement_GetDevice
  635.     ENDIF
  636.  
  637. ; *
  638. ; * takes an ISpElementReference and gives the ISpElementInfo for that Element.  This is the
  639. ; * the set of standard information.  You get ISpElementKind specific information
  640. ; * through ISpElement_GetConfigurationInfo.
  641. ; *
  642. ; * Return Codes
  643. ; * paramErr if inElement is 0 or outInfo is nil
  644. ; *
  645.  
  646. ;
  647. ; extern OSStatus ISpElement_GetInfo(ISpElementReference inElement, ISpElementInfoPtr outInfo)
  648. ;
  649.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  650.         IMPORT_CFM_FUNCTION ISpElement_GetInfo
  651.     ENDIF
  652.  
  653. ; *
  654. ; *         
  655. ; *
  656. ; * takes an ISpElementReference and gives the ISpElementKind specific configuration information
  657. ; * 
  658. ; * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will
  659. ; * copy buflen bytes of the data into the block of memory pointed to by configInfo and
  660. ; * will return something error.
  661. ; *
  662. ; * Return Codes
  663. ; * paramErr if inElement or configInfo is nil
  664. ; *
  665.  
  666. ;
  667. ; extern OSStatus ISpElement_GetConfigurationInfo(ISpElementReference inElement, UInt32 buflen, void *configInfo)
  668. ;
  669.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  670.         IMPORT_CFM_FUNCTION ISpElement_GetConfigurationInfo
  671.     ENDIF
  672.  
  673. ; *
  674. ; * ISpElement_GetSimpleState
  675. ; *
  676. ; * Takes an ISpElementReference and returns the current state of that element.  This is a 
  677. ; * specialized version of ISpElement_GetComplexState that is only appropriate for elements
  678. ; * whose data fits in a signed 32 bit integer.
  679. ; *
  680. ; *
  681. ; *
  682. ; * Return Codes
  683. ; * paramErr if inElement is 0 or state is nil
  684. ; *
  685.  
  686. ;
  687. ; extern OSStatus ISpElement_GetSimpleState(ISpElementReference inElement, UInt32 *state)
  688. ;
  689.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  690.         IMPORT_CFM_FUNCTION ISpElement_GetSimpleState
  691.     ENDIF
  692.  
  693. ; *
  694. ; * ISpElement_GetComplexState
  695. ; *
  696. ; * Takes an ISpElementReference and returns the current state of that element.  
  697. ; * Will copy up to buflen bytes of the current state of the device into
  698. ; * state.
  699. ; *
  700. ; *
  701. ; * Return Codes
  702. ; * paramErr if inElement is 0 or state is nil
  703. ; *
  704.  
  705. ;
  706. ; extern OSStatus ISpElement_GetComplexState(ISpElementReference inElement, UInt32 buflen, void *state)
  707. ;
  708.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  709.         IMPORT_CFM_FUNCTION ISpElement_GetComplexState
  710.     ENDIF
  711.  
  712.  
  713. ; * ISpElement_GetNextEvent
  714. ; *
  715. ; * It takes in an element  reference and the buffer size of the ISpElementEventPtr
  716. ; * it will set wasEvent to true if there was an event and false otherwise.  If there
  717. ; * was not enough space to fill in the whole event structure that event will be
  718. ; * dequed, as much of the event as will fit in the buffer will by copied and
  719. ; * ISpElement_GetNextEvent will return an error.
  720. ; *
  721. ; * Return Codes
  722. ; * paramErr
  723. ; *
  724.  
  725. ;
  726. ; extern OSStatus ISpElement_GetNextEvent(ISpElementReference inElement, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent)
  727. ;
  728.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  729.         IMPORT_CFM_FUNCTION ISpElement_GetNextEvent
  730.     ENDIF
  731.  
  732. ; *
  733. ; * ISpElement_Flush
  734. ; *
  735. ; * It takes an ISpElementReference and flushes all the events on that element.  All it guaruntees is
  736. ; * that any events that made it to this layer before the time of the flush call will be flushed and
  737. ; * it will not flush any events that make it to this layer after the time when the call has returned.
  738. ; * What happens to events that occur during the flush is undefined.
  739. ; *
  740. ; *
  741. ; * Return Codes
  742. ; * paramErr
  743. ; *
  744.  
  745. ;
  746. ; extern OSStatus ISpElement_Flush(ISpElementReference inElement)
  747. ;
  748.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  749.         IMPORT_CFM_FUNCTION ISpElement_Flush
  750.     ENDIF
  751.  
  752.  
  753.  
  754. ; * ISpElementList_New
  755. ; *
  756. ; * Creates a new element list and returns it in outElementList.  In count specifies 
  757. ; * the number of element references in the list pointed to by inElements.  If inCount
  758. ; * is non zero the list is created with inCount elements in at as specified by the 
  759. ; * inElements parameter.  Otherwise the list is created empty.
  760. ; *
  761. ; *
  762. ; * Return Codes
  763. ; * out of memory - If it failed to allocate the list because it was out of memory
  764. ;                   it will also set outElementList to 0
  765. ; * paramErr if outElementList was nil
  766. ; *
  767. ; *
  768. ; * Special Concerns
  769. ; *
  770. ; * interrupt unsafe
  771. ; *
  772.  
  773. ;
  774. ; extern OSStatus ISpElementList_New(UInt32 inCount, ISpElementReference *inElements, ISpElementListReference *outElementList, UInt32 flags)
  775. ;
  776.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  777.         IMPORT_CFM_FUNCTION ISpElementList_New
  778.     ENDIF
  779.  
  780. ; * ISpElementList_Dispose
  781. ; *
  782. ; * Deletes an already existing memory list.  
  783. ; *
  784. ; *
  785. ; * Return Codes
  786. ; * paramErr if inElementList was 0
  787. ; *
  788. ; *
  789. ; * Special Concerns
  790. ; *
  791. ; * interrupt unsafe
  792. ; *
  793.  
  794. ;
  795. ; extern OSStatus ISpElementList_Dispose(ISpElementListReference inElementList)
  796. ;
  797.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  798.         IMPORT_CFM_FUNCTION ISpElementList_Dispose
  799.     ENDIF
  800.  
  801. ; * ISpGetGlobalElementList
  802. ; *
  803. ; * returns the global element list
  804. ; *
  805. ; * Return Codes
  806. ; * paramErr if outElementList is nil
  807. ; *
  808.  
  809. ;
  810. ; extern OSStatus ISpGetGlobalElementList(ISpElementListReference *outElementList)
  811. ;
  812.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  813.         IMPORT_CFM_FUNCTION ISpGetGlobalElementList
  814.     ENDIF
  815.  
  816. ; * ISpElementList_AddElement
  817. ; *
  818. ; * adds an element to the element list
  819. ; *
  820. ; * Return Codes
  821. ; * paramErr if inElementList is 0 or newElement is 0
  822. ; * memory error if the system is unable to allocate enough memory
  823. ; *
  824. ; * Special Concerns
  825. ; * interrupt Unsafe
  826. ; * 
  827.  
  828. ;
  829. ; extern OSStatus ISpElementList_AddElements(ISpElementListReference inElementList, UInt32 refCon, UInt32 count, ISpElementReference *newElements)
  830. ;
  831.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  832.         IMPORT_CFM_FUNCTION ISpElementList_AddElements
  833.     ENDIF
  834.  
  835. ; * ISpElementList_RemoveElement
  836. ; *
  837. ; * removes the specified element from the element list
  838. ; *
  839. ; * Return Codes
  840. ; * paramErr if inElementList is 0 or oldElement is 0
  841. ; * memory error if the system is unable to allocate enough memory
  842. ; *
  843. ; * Special Concerns
  844. ; * interrupt Unsafe
  845. ; * 
  846.  
  847. ;
  848. ; extern OSStatus ISpElementList_RemoveElements(ISpElementListReference inElementList, UInt32 count, ISpElementReference *oldElement)
  849. ;
  850.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  851.         IMPORT_CFM_FUNCTION ISpElementList_RemoveElements
  852.     ENDIF
  853.  
  854. ; * ISpElementList_Extract
  855. ; *
  856. ; * ISpElementList_Extract will extract as many of the elements from an element list as possible.  You pass
  857. ; * in an element list, a pointer to an array of element references and the number of elements in that array.
  858. ; * It will return how many items are in the element list in the outCount parameter and copy the minimum of 
  859. ; * that number and the size of the array into the buffer.
  860. ; *
  861. ; * ByKind and ByLabel are the same except that they will only count and copy element references to elements
  862. ; * that have the specified kind and label.
  863. ; *
  864. ; * Return Codes
  865. ; * paramErr
  866. ; *
  867.  
  868. ;
  869. ; extern OSStatus ISpElementList_Extract(ISpElementListReference inElementList, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  870. ;
  871.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  872.         IMPORT_CFM_FUNCTION ISpElementList_Extract
  873.     ENDIF
  874.  
  875. ;
  876. ; extern OSStatus ISpElementList_ExtractByKind(ISpElementListReference inElementList, ISpElementKind inKind, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  877. ;
  878.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  879.         IMPORT_CFM_FUNCTION ISpElementList_ExtractByKind
  880.     ENDIF
  881.  
  882. ;
  883. ; extern OSStatus ISpElementList_ExtractByLabel(ISpElementListReference inElementList, ISpElementLabel inLabel, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  884. ;
  885.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  886.         IMPORT_CFM_FUNCTION ISpElementList_ExtractByLabel
  887.     ENDIF
  888.  
  889. ; * ISpElementList_GetNextEvent
  890. ; *
  891. ; * It takes in an element list reference and the buffer size of the ISpElementEventPtr
  892. ; * it will set wasEvent to true if there was an event and false otherwise.  If there
  893. ; * was not enough space to fill in the whole event structure that event will be
  894. ; * dequed, as much of the event as will fit in the buffer will by copied and
  895. ; * ISpElementList_GetNextEvent will return an error.
  896. ; *
  897. ; * Return Codes
  898. ; * paramErr
  899. ; *
  900.  
  901. ;
  902. ; extern OSStatus ISpElementList_GetNextEvent(ISpElementListReference inElementList, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent)
  903. ;
  904.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  905.         IMPORT_CFM_FUNCTION ISpElementList_GetNextEvent
  906.     ENDIF
  907.  
  908. ; *
  909. ; * ISpElementList_Flush
  910. ; *
  911. ; * It takes an ISpElementListReference and flushes all the events on that list.  All it guaruntees is
  912. ; * that any events that made it to this layer before the time of the flush call will be flushed and
  913. ; * it will not flush any events that make it to this layer after the time when the call has returned.
  914. ; * What happens to events that occur during the flush is undefined.
  915. ; *
  916. ; *
  917. ; * Return Codes
  918. ; * paramErr
  919. ; *
  920.  
  921. ;
  922. ; extern OSStatus ISpElementList_Flush(ISpElementListReference inElementList)
  923. ;
  924.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  925.         IMPORT_CFM_FUNCTION ISpElementList_Flush
  926.     ENDIF
  927.  
  928. ; *
  929. ; * ISpTimeToMicroseconds
  930. ; *
  931. ; *
  932. ; * This function takes time from an input sprocket event and converts it
  933. ; * into microseconds. (Version 1.2 or later of InputSprocket.)
  934. ; *
  935. ; *
  936. ; * Return Codes
  937. ; * paramErr
  938. ; *
  939.  
  940. ;
  941. ; extern OSStatus ISpTimeToMicroseconds(const AbsoluteTime *inTime, UnsignedWide *outMicroseconds)
  942. ;
  943.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  944.         IMPORT_CFM_FUNCTION ISpTimeToMicroseconds
  945.     ENDIF
  946.  
  947.  
  948.     ENDIF    ; TARGET_CPU_PPC
  949.  
  950.     ENDIF ; __INPUTSPROCKET__ 
  951.  
  952.